
#include"Thread.hpp"
#include <unistd.h>

std::string GetThreadName(){
    static int number =1;
    char name[64];
    snprintf(name,sizeof(name),"Thread-%d",number++);
    return name;
}
void Print(int num){
     while(true){
        std::cout<<"hello world"<<num--<<std::endl;
        sleep(1);
    }
}
int main(){
   Thread<int> t(GetThreadName(), Print, 10);
    // Thread t(Print,GetThreadName());
    // std::cout<<"is thread running?"<<t.IsRunning()<<std::endl;
    // t.Start();
    // t.Join();
    // const int num=5;
    // std::vector<Thread> threads;
    // for(int i=0;i<num;i++){
    //     threads.push_back(Thread(Print,GetThreadName()));
    // }
    // for( auto &t : threads){
    //    std::cout<<t.ThreadName()<<", is running "<<t.IsRunning()<<std::endl;
    // }
    return 0;
}
